package behavioral.command.base.objs;

/**
 * 风扇，复杂一些的对象
 */
public class Fan {
    int speed; // 风速
    String location; // 位置
    public static final int HIGHT = 3;
    public static final int MEDIUM = 2;
    public static final int LOW = 1;
    public static final int CLOSE = 0;

    public Fan(String location) {
        this.location = location;
        speed = CLOSE;
    }

    public void hight() {
        speed = HIGHT;
    }

    public void medium() {
        speed = MEDIUM;
    }

    public void low() {
        speed = LOW;
    }

    public void off() {
        speed = CLOSE;
    }

    public int getSpeed() {
        return speed;
    }
}
